<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>数组去重</title>
		<script>
		function del(arr){
			var newArr = [];
						for (var i = 0; i < arr.length; i++) {
							var bool = true;
							//每次都要判断新数组中是否有旧数组中的值。
							for (var j = 0; j < newArr.length; j++) {
								if (arr[i] === newArr[j]) {
									bool = false;
								}
							}
							if (bool) {
								newArr[newArr.length] = arr[i];
							}
						}return newArr;
		}console.log(del([1,2,3,4,6,8,1,3,2,5]))
		</script>
	</head>
	<body>
		<h1>数组去重</h1>
	</body>
</html>
